﻿using System;
using System.Configuration;

namespace Gonte.Plugin
{
    public class PluginConfigurationSection
        : ConfigurationSection
    {
        #region Constants

        internal const string PluginConfigurationSectionString = "PluginConfigurationSection";

        #endregion

        #region Properties

        /// <summary>
        /// Indicates the path to the configuration file or embedded resource
        /// </summary>
        [ConfigurationProperty("directory", DefaultValue = @"C:\Plugins", IsRequired = true)]
        [StringValidator(InvalidCharacters = "!@#$%^&*", MinLength = 1, MaxLength = 255)]
        public string PluginsDirectory
        {
            get
            {
                return (string)this["directory"];
            }

            set
            {
                this["directory"] = value;
            }
        }

        #endregion
    }
}
